﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using slava.dao;

namespace DAO
{
    public class DaoRepository
    {
        private EmployeeRepository employeeRepository;
        private ProductRepository productRepository;
        private ProviderRepository providerRepository;

        private ClientsRepository clientsRepository;
        private ExtraditionRepository extraditionRepository;
        private AcceptanceRepository acceptanceRepository;

        private KindRepository kindRepository;
        private CategoryRepository categoryRepository;
        private AcceptanceProductRepository acceptanceProductRepository;
        private ExtraditionProductRepository extraditionProductRepository;


        private skladEntities sklad;

        public DaoRepository()
        {
            sklad = new skladEntities();
        }

        public EmployeeRepository EmployeeRepository
        {
            get
            {
                if (employeeRepository == null)
                    employeeRepository = new EmployeeRepository();
                return this.employeeRepository;
            }
        }

        public ProductRepository ProductRepository 
        {
            get
            {
                if (productRepository == null)
                    productRepository = new ProductRepository();
                return this.productRepository;
            }
        }

        public ProviderRepository ProviderRepository
        {
            get
            {
                if (providerRepository == null)
                    providerRepository = new ProviderRepository();
                return this.providerRepository;
            }
        }

        public ClientsRepository ClientRepository
        {
            get
            {
                if (clientsRepository == null)
                    clientsRepository = new ClientsRepository();
                return this.clientsRepository;
            }
        }

        public ExtraditionRepository ExtraditionRepository
        {
            get
            {
                if (extraditionRepository == null)
                    extraditionRepository = new ExtraditionRepository();
                return this.extraditionRepository;
            }
        }

        public AcceptanceRepository AcceptanceRepository
        {
            get
            {
                if (acceptanceRepository == null)
                    acceptanceRepository = new AcceptanceRepository();
                return this.acceptanceRepository;
            }
        }

        public KindRepository KindRepository
        {
            get
            {
                if (kindRepository == null)
                    kindRepository = new KindRepository();
                return this.kindRepository;
            }
        }

        public CategoryRepository CategoryRepository
        {
            get
            {
                if (categoryRepository == null)
                    categoryRepository = new CategoryRepository();
                return this.categoryRepository;
            }
        }

        public AcceptanceProductRepository AcceptanceProductRepository
        {
            get
            {
                if (acceptanceProductRepository == null)
                    acceptanceProductRepository = new AcceptanceProductRepository();
                return this.acceptanceProductRepository;
            }
        }

        public ExtraditionProductRepository ExtraditionProductRepository
        {
            get
            {
                if (extraditionProductRepository == null)
                    extraditionProductRepository = new ExtraditionProductRepository();
                return this.extraditionProductRepository;
            }
        }
    }
}
